﻿using System;
using System.Collections.Generic;
using System.Text;
using Castle.ActiveRecord;
using Castle.Components.Validator;
using MiragePWF.NH.Validation;
using Wolfut.MirageEE.Kernal.Common;
using Wolfut.MirageEE.Domain.CommonUtilities;

namespace Wolfut.MirageEE.Domain.Products
{
    /// <summary>
    /// 往来初始余额
    /// </summary>
    [ActiveRecord("BUSINESS_INITIAL_BALANCES")]
    public class BusinessInitialBalance : PersistentObjectWithGuid
    {
        #region 业务类型
        private string businessType = string.Empty;
        /// <summary>
        /// 业务类型
        /// </summary>
        [Property("BUSINESS_TYPE")]
        [ValidateNonEmpty, ValidateLength(0, 40, "业务类型超长！")]
        public virtual string BusinessType
        {
            get
            {
                return businessType;
            }
            set
            {
                businessType = value;
            }
        }
        #endregion

        #region 币别代码
        private string currencyCode = string.Empty;

        /// <summary>
        /// 币别代码
        /// </summary>
        [Property("CURRENCY_CODE")]
        [ValidateLength(0, 40, "币别代码超长！")]
        public virtual string CurrencyCode
        {
            get
            {
                return currencyCode;
            }
            set
            {
                currencyCode = value;
            }
        }
        #endregion

        #region 往来单位名称
        private string tradeFirmName = string.Empty;
        /// <summary>
        /// 往来单位名称
        /// </summary>
        [Property("TRADE_FIRM_NAME")]
        [ValidateLength(0, 40, "往来单位名称超长！")]
        public virtual string TradeFirmName
        {
            get
            {
                return tradeFirmName;
            }
            set
            {
                tradeFirmName = value;
            }
        }
        #endregion

        #region 余额日期
        private DateTime balanceDate;
        /// <summary>
        /// 余额日期
        /// </summary>
        [Property("BALANCE_DATE")]        
        public virtual DateTime BalanceDate
        {
            get
            {
                return balanceDate;
            }
            set
            {
                balanceDate = value;
            }
        }
        #endregion

        #region 金额
        private Decimal totalSum;
        /// <summary>
        /// 金额
        /// </summary>
        [Property("TOTAL_SUM")]
        public virtual Decimal TotalSum
        {
            get
            {
                return totalSum;
            }
            set
            {
                totalSum = value;
            }
        }
        #endregion     

        #region 支付方式
        /// <summary>
        /// 支付方式
        /// </summary>
        String paymentMode;
        [Property("PAYMENT_MODE")]
        [ValidateLength(0, 100, "支付方式超长！")]
        public virtual string PaymentMode
        {
            get
            {
                return paymentMode;
            }
            set
            {
                paymentMode = value;
            }
        }
        #endregion

        #region 往来账户
        /// <summary>
        /// 往来账户
        /// </summary>
        String tradeAccount;
        [Property("TRADE_ACCOUNT")]
        [ValidateLength(0, 100, "往来账户超长！")]
        public virtual string TradeAccount
        {
            get
            {
                return tradeAccount;
            }
            set
            {
                tradeAccount = value;
            }
        }
        #endregion

        #region 逻辑删除
        private Boolean isDeleted;
        [Property("IS_DELETED")]
        public virtual Boolean IsDeleted
        {
            get
            {
                return isDeleted;
            }
            set
            {
                isDeleted = value;
            }
        }
        #endregion

        #region 备注
        private string remark;
        /// <summary>
        /// 备注
        /// </summary>
        [Property("REMARKS")]
        [ValidateLength(0, 2000, "备注超长！")]
        public virtual string Remark
        {
            get
            {
                return remark;
            }
            set
            {
                remark = value;
            }
        }
        #endregion

        #region 借贷标记
        private OnLoanFlag debitCreditFlag = OnLoanFlag.LoanIn;
        /// <summary>
        /// 备注
        /// </summary>
        [Property("DEBIT_CREDIT_FLAG")]
        public virtual OnLoanFlag DebitCreditFlag
        {
            get
            {
                return debitCreditFlag;
            }
            set
            {
                debitCreditFlag = value;
            }
        }
        #endregion
    }
}

